In a system consisting of a numerical control device (hereinafter referred to as CNC device), a robot-controller and its peripheral devices or similar industrial device, it is sometimes necessary to link a plurality of devices by means of serial communication for the purpose of ensuring that they operate in synchronization with one another. For instance, machine-tools which are driven and controlled by CNC devices must be synchronized in order to detect the current position of the individual feed shafts at the same point in time. Similarly, the individual shafts have to be moved in synchronization. Signals for the purpose of implementing synchronization of this sort are transmitted by way of serial communication.
For instance, FIG. 13 illustrates a system where two machines (master and slave) are connected by communication. One method of controlling the slave machine by synchronizing it with the aid of serial communication to the master machine involves emitting from the master machine to the slave machine a signal requesting transmission of a synchronizing signal with a predetermined cycle from a timer at a time which is to form the basis for synchronization, transmitting a packet (frame) on a transmission control circuit identifying it as a synchronizing signal, and transmitting this packet after conversion to a serial signal by means of a parallel-serial converter. Each time the reception control circuit of the slave machine receives this packet by way of a serial-parallel converter, it either operates its own internal sequencer or controls its own internal timer in such a manner as to make it conform to the timer of the master machine. This method is well known.
The packet which is transmitted from the master machine for the purpose of synchronization may be for exclusive use. Provided that a request for the transmission of data from the master machine is generated with synchronous timing, this data packet itself is sometimes treated as synchronization information. FIG. 14 illustrates an example of this packet. The slave machine may treat reception of either the whole packet or just the header section of the packet as a synchronization information.
When a packet is transmitted by serial communication, there is a discrepancy equivalent at least to the length of the serial data between the timing with which the transmitting side begins transmitting and that with which the receiving side finishes receiving the data.
FIG. 15 is a diagram which elucidates this discrepancy in timing for the example shown in FIG. 13. In FIG. 15 only the header section is treated as synchronization data (synchronizing signal). It is assumed that a request for transmission is generated cyclically in accordance with an internal timer in the master machine, and that now at a given time (reference time t0) such a request for transmission has been generated from the timer of the master machine. The transmission control circuit transmits a packet of the type illustrated in FIG. 14 to the parallel-serial converter, where it is converted into a serial signal and transmitted to the slave machine. There is a delay D1 from the time at which this signal requesting transmission was generated until the packet is transmitted to the transmission line. The reception of this packet by the slave machine entails further delays in the forms of the propagation time on the transmission line Dp and the time D2 required for synchronization. Inasmuch as the slave machine becomes aware of the arrival of the header section only after a fixed interval D3 from the completion of its reception, the synchronizing signal (header detection signal) generated by the slave machine is subject to a delay equivalent to the total of the delays (D1+Dp+D2+D3) from the time t0 at which the request for transmission was generated by the master machine.
Conventionally, the propagation delay time Dp during which the signal propagates along the transmission line has been regarded as capable of being ignored. The remaining delay times D1, D2 and D3 are always constant and can be determined without difficulty from the circuitry configuration which was adopted at the time of designing the master and slave machines. Thus, when synchronizing in the conventional manner by the internal timer in the slave machine, the delay (D1+D2+D3) determined from the circuitry configuration is previously set in the slave machine as a correction value. When the slave machine detects the synchronizing signal (header detection signal), it sets the correction value as the initial value in the internal timer to activate the timer. The timer takes `time up` (the time when the internal timer in the master machine has measured the value obtained by subtracting the correction value from the time beginning with the reference time t0 and ending with synchronization time T) as the synchronization time, thereby accomplishing desired synchronization by making correction corresponding to the delay. The opposite method is also used, whereby the delay is corrected by advancing the timing with which transmission begins from the master machine by the known amount of the delay and controlling the internal timer in the slave machine, by regarding the time at which the synchronizing signal (header detection signal) is detected as reference time.
The higher the communication rate (bit rate), the more accurate synchronization control of serial communication becomes. For example, an accuracy of approximately 1 ms at 1 Mbps rises to about 10 ns at 100 Mbps. At such a degree of accuracy it is no longer possible to overlook the time Dp which is required in order for the signal to propagate the serial communication. The time it takes for the signal to propagate along the transmission line is roughly 5 ns/m in the case of optical fibres, so that a delay of 50 ns is generated in propagating 10 m.
Nor is it possible to overlook the propagation delay even where the communication rate (bit rate) is slow if the transmission line is long.